﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Guline.Web.CentralModels.Object
{
    public class Account
    {
        [Key]
        [DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        public string UserName { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        [Display(Name = "lblDisplayName", ResourceType = typeof(Guline.Web.CentralLanguages.Main))]
        [Required(ErrorMessageResourceName = "lblRequireDisplayName", ErrorMessageResourceType = typeof(Guline.Web.CentralLanguages.Validation))]
        public string DisplayName { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public DateTime BirthDay { get; set; }
        public Nullable<bool> Gender { get; set; }

        public Account()
        {
            this.BirthDay = DateTime.Now;
        }

        [InverseProperty("Account")]
        public virtual ICollection<CApp> CApps { get; set; }

        [InverseProperty("Account")]
        public virtual ICollection<Device> Devices { get; set; }

        [InverseProperty("Account")]
        public virtual ICollection<Message> Messages { get; set; }
        
    }
}
